﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using QLHocSinh.DAO;
using QLHocSinh.DTO;
using QLHocSinh.BUS;

namespace QLHocSinh.DAO
{
    class UserDAO
    {
        public static DataTable SelectAll()
        {
            string Sql = "SELECT * FROM USER";
            return Config.AccessHelper.ExecuteQuery(Sql);
        }
        public static bool KiemTraUser(UserDTO user)
        {
            string sql = "select * from USER where Username = '" + user.Username + "' and Password = '" + user.Password + "'";
            DataTable dt = Config.AccessHelper.ExecuteQuery(sql);
            if (dt.Rows.Count != 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
